<template>
  <div style="height: 50px;line-height: 50px;border-bottom: 1px solid #ccc;display: flex">
    <img src="@/assets/museum.png" alt="" style="width:40px;position:relative;left: 20px">
    <div style="width: 250px;padding-left: 30px;font-weight: bolder;color: deepskyblue;font-size: 24px"> 博物馆后台管理系统 </div>
    <div>

    </div>
    <div style="width: 100px;margin-top: 16px;flex: 1;text-align: right;padding-right: 50px">
      <el-dropdown size="medium">
        <span class="el-dropdown-link" style="cursor: pointer">
         <el-avatar :size="42" :src="admin.avatar" style="margin:-12px 8px"></el-avatar>
          {{ admin.adminName}}
          <el-icon class="el-icon--right">
            <arrow-down />
          </el-icon>
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item @click="this.$router.push('/person')">个人信息</el-dropdown-item>
<!--            $router.push('/login')-->
            <el-dropdown-item @click="this.$router.push('/login')">退出系统</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import { ArrowDown } from '@element-plus/icons-vue'
import Cookies from 'js-cookie'
export default {
  name: "Header",
  components:{
    ArrowDown
  },
  data(){
    return {
      admin: Cookies.get('admin') ? JSON.parse(Cookies.get('admin')) :{}
    }
  },
  mounted() {
    console.log("admin内容是",this.admin)
  },
  methods:{
  }
}
</script>

<style scoped>
.el-dropdown-link {
  cursor: pointer;
  color: #24dcf3;
  display: flex;
  align-items: center;
}
/*消除边框*/
:focus{
  outline:0;
}
</style>